﻿<Window x:Class="ResourceBlender_Express.WinAddElement"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:ResourceBlender_Express"
    xmlns:validators="clr-namespace:ResourceBlender_Express.Validators"
    loc:WindowService.EscapeClosesWindow="True"
    Title="Add Element" Height="275" Width="400"
    SizeToContent="Height" WindowStartupLocation="CenterOwner"
    Style="{StaticResource {x:Type Window}}" Icon="/ResourceBlender-Express;component/images/resourceblender.ico">
    <Window.Resources>
        
    </Window.Resources>
    <DockPanel>
        <Grid DockPanel.Dock="Top" Margin="6">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Grid.Column="0">Element Name</Label>
            <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" x:Name="txtElement">
                <Binding Path="Name" Mode="TwoWay">
                    <Binding.ValidationRules>
                        <validators:StringValidationRule MinimumLength="1" MaximumLength="255" ErrorMessage="Element name must be between 1 and 255 characters" />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox>
            
            <Label Grid.Row="1" Grid.Column="0" ToolTip="Comments about the element. Eg: Where it's used">Comment</Label>
            <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" x:Name="txtComment" Text="{Binding Path=Comment,Mode=TwoWay}" />
                    
            <Label Grid.Row="2" Grid.Column="0">Bundle</Label>
            <ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" x:Name="cboBundle" DisplayMemberPath="Value" SelectedValue="{Binding BundleID,Mode=TwoWay}" SelectedValuePath="Key"></ComboBox>
            
            <Label Grid.Row="3" Grid.Column="0">Resource</Label>
            <ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" x:Name="cboResource" DisplayMemberPath="Value" SelectedValue="{Binding Resource.ID,Mode=OneWay}" SelectedValuePath="Key" SelectionChanged="cboBundle_SelectionChanged"></ComboBox>
            
            <Label Grid.Row="4" Grid.Column="0" ToolTip="Comments about the element. Eg: Where it's used">Resource Comment</Label>
            <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" x:Name="txtResourceComment" Text="{Binding Path=Resource.Comment,Mode=TwoWay}" />
            
            <Label Grid.Row="5" Grid.Column="0" x:Name="lblDefaultLanguage" />
            <TextBox Grid.Row="5" Grid.Column="1" x:Name="txtDefaultLanguage" />
            <!--loc:ToolBarButton Grid.Row="4" Grid.Column="2" x:Name="btnFindSimilarDefault" Image="images/add_16.png" ToolTip="Find Similar Translations" />
            <loc:ToolBarButton Grid.Row="4" Grid.Column="2" x:Name="btnOpenFullDefault" Image="images/add_16.png" ToolTip="Open Full Editor" /-->
            
            
            
            <Expander Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" x:Name="expTranslations" Header="Translations">
                <ScrollViewer VerticalScrollBarVisibility="Auto" Height="350">
                    <Grid x:Name="grdTranslations">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                    </Grid>
                </ScrollViewer>
            </Expander>
            
            <StackPanel Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                <Button x:Name="btnSave" Width="70" IsDefault="True" Click="btnSave_Click">Save</Button>
                <Button x:Name="btnCancel" Width="70" IsCancel="True" Click="btnCancel_Click" Margin="2,2,0,2">Cancel</Button>
            </StackPanel>
        </Grid>
    </DockPanel>
</Window>
